"""菜单 API Router."""
from typing import List
from typing_extensions import Annotated
from fastapi import APIRouter, Depends

from api.v1.models.menu import MenuResponse
from api.v1.models.response import response_500
from service.menu_service import MenuService

router = APIRouter()


@router.get("/menus",
            summary="菜单列表查询",
            responses={**response_500})
async def read_menus(
    menu_service: Annotated[MenuService, Depends()],
) -> List[MenuResponse]:
# """
# 查看主/子菜单列表。
# -使用LRU（Least Recently Used）缓存进行查询。
# """
    return menu_service.fetch_menus()
